﻿using CloudPms.Logic.Business;

namespace CloudPms.Web.Controllers
{
    /// <summary>
    /// 中央缓存初始化启动中心
    /// <para>--------------------------</para>
    /// <para>@Author: cnalexi@gmail.com</para> 
    /// <para>@Create: 2012/10/11</para> 
    /// </summary>
    public class Initialization
    {
        /// <summary>
        /// 启动缓存控制台
        /// </summary>
        public static void StartCacheMonitor()
        {
            var cm= CacheMonitor.GetInstance();

            System.Threading.Tasks.Task.Factory.StartNew(cm.Initialization);
        }

        /// <summary>
        /// 重建缓存
        /// </summary>
        public static void StartRebuildCache()
        {
            var cm = CacheMonitor.GetInstance();

            Common.CacheProvider.CenterCacheInit.ReStart();

            System.Threading.Tasks.Task.Factory.StartNew(cm.Initialization); 
        }
    }
}
